#!/usr/bin/env bash
set -ex

JAR=springboot-mybatis-quickstarter-1.0-SNAPSHOT.jar

#git pull
mvn clean
mvn package
#scp target/$JAR chester@www.chester.vip:/var/data/war/springboot-mybatis-quickstarter/target/
#scp target/$JAR chester@www.chester.vip:/var/data/war/springboot-mybatis-quickstarter/target/$JAR.$(date +%Y-%m-%d_%H:%M:%S)


#CONTAINER_NAME=springboot-mybatis-quickstarter.chester
#IMAGE_NAME=springboot-mybatis-quickstarter/chester:v1.0.0

# 第一次执行，注释掉下面2行
#docker stop $CONTAINER_NAME
#docker rm $CONTAINER_NAME
#docker rmi $IMAGE_NAME
#mvn install dockerfile:build
#docker build --tag=$IMAGE_NAME .
#docker create --name=$CONTAINER_NAME -p 8080:8080 -p 5000:5000 $IMAGE_NAME
#docker start $CONTAINER_NAME
#docker logs -f --tail=100 $CONTAINER_NAME

